package com.atguigu.day10.test14;

public class Rectangle extends Graphic{
    private double a,b;

    public Rectangle(double a, double b) {
        this.a = a;
        this.b = b;
    }

    public double getA() {
        return a;
    }

    public void setA(double a) {
        this.a = a;
    }

    public double getB() {
        return b;
    }

    public void setB(double b) {
        this.b = b;
    }

    @Override
    public double getArea() {
        return a*b;
    }

    @Override
    public double getPerimeter() {
        return 2*(a+b);
    }

    @Override
    public String getInfo() {
        return "长和宽为:"+a+","+b+",面积为:"+getArea()+",周长为:"+getPerimeter();
    }
}